package cn.itsource.mapper;

import cn.itsource.domain.Article;
import cn.itsource.dto.ArticleDat;
import cn.itsource.query.Query;

import java.util.List;

public interface ArticleMapper {

    public List<Article> findAll();

    public Article findOne(Long id);

    public void add(Article article);

    public void update(Article article);

    public void delete(Long id);

    //分页+模糊查询
    List<Article> pageQuery(Query query);

    //批量删除
    void patchdel(Long[] ids);


    //获取文章类型
    List<ArticleDat> articleType();

    //获取时间统计
    List<ArticleDat> timecount();

    //获取相关文章内容
    List<Article> relatedArticles(Long id);

    //根据article_typeid 获取文章数据
    List<Article> articleList(Long articleTypeId);

    //获取按照年份分组
    List<Article> yearGrougBy();

    List<Article> getNameandReadCount();

    //扇形
    List<ArticleDat> sector();

    List<Article> getBlogGdList();

    //数据库tb_ipaddress表有ip地址 - 以前点赞了 - 再点就是取消点赞
    void decreStar(Long id);

    //未点赞，给tb_article表article_star_num字段+1
    void increStar(Long id);
}
